<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Os1: DUtils::Random Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Os1
   &#160;<span id="projectnumber">1</span>
   </div>
   <div id="projectbrief">OrbSlam2 documentado y modificado</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,'Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_d_utils_1_1_random.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pri-static-attribs">Static Private Attributes</a> &#124;
<a href="class_d_utils_1_1_random-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">DUtils::Random Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Functions to generate pseudo-random numbers.  
 <a href="class_d_utils_1_1_random.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_random_8h_source.html">Random.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random_1_1_unrepeated_randomizer.html">UnrepeatedRandomizer</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides pseudo-random numbers with no repetitions.  <a href="class_d_utils_1_1_random_1_1_unrepeated_randomizer.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a2c769bcd60a08fc3eba3ef4abf9761d5"><td class="memTemplParams" colspan="2">template&lt;class T &gt; </td></tr>
<tr class="memitem:a2c769bcd60a08fc3eba3ef4abf9761d5"><td class="memTemplItemLeft" align="right" valign="top">static T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random.html#a2c769bcd60a08fc3eba3ef4abf9761d5">RandomGaussianValue</a> (T mean, T sigma)</td></tr>
<tr class="memdesc:a2c769bcd60a08fc3eba3ef4abf9761d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a random number from a gaussian distribution.  <a href="#a2c769bcd60a08fc3eba3ef4abf9761d5">More...</a><br /></td></tr>
<tr class="separator:a2c769bcd60a08fc3eba3ef4abf9761d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa25012101ecbca54025d5430bcf93d86"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random.html#aa25012101ecbca54025d5430bcf93d86">RandomInt</a> (int min, int max)</td></tr>
<tr class="memdesc:aa25012101ecbca54025d5430bcf93d86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a random int in the range [min..max].  <a href="#aa25012101ecbca54025d5430bcf93d86">More...</a><br /></td></tr>
<tr class="separator:aa25012101ecbca54025d5430bcf93d86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5d2e4d977afdec30071c531a7a96d88"><td class="memTemplParams" colspan="2">template&lt;class T &gt; </td></tr>
<tr class="memitem:ac5d2e4d977afdec30071c531a7a96d88"><td class="memTemplItemLeft" align="right" valign="top">static T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random.html#ac5d2e4d977afdec30071c531a7a96d88">RandomValue</a> ()</td></tr>
<tr class="memdesc:ac5d2e4d977afdec30071c531a7a96d88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a random number in the range [0..1].  <a href="#ac5d2e4d977afdec30071c531a7a96d88">More...</a><br /></td></tr>
<tr class="separator:ac5d2e4d977afdec30071c531a7a96d88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13760f5d6d4b866fbcc350dbb0d39d02"><td class="memTemplParams" colspan="2">template&lt;class T &gt; </td></tr>
<tr class="memitem:a13760f5d6d4b866fbcc350dbb0d39d02"><td class="memTemplItemLeft" align="right" valign="top">static T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random.html#a13760f5d6d4b866fbcc350dbb0d39d02">RandomValue</a> (T min, T max)</td></tr>
<tr class="memdesc:a13760f5d6d4b866fbcc350dbb0d39d02"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a random number in the range [min..max].  <a href="#a13760f5d6d4b866fbcc350dbb0d39d02">More...</a><br /></td></tr>
<tr class="separator:a13760f5d6d4b866fbcc350dbb0d39d02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a719a6489316343a771e062f0be58050f"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random.html#a719a6489316343a771e062f0be58050f">SeedRand</a> ()</td></tr>
<tr class="memdesc:a719a6489316343a771e062f0be58050f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the random number seed to the current time.  <a href="#a719a6489316343a771e062f0be58050f">More...</a><br /></td></tr>
<tr class="separator:a719a6489316343a771e062f0be58050f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec19d58856a0cf0b48d783119a497233"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random.html#aec19d58856a0cf0b48d783119a497233">SeedRand</a> (int seed)</td></tr>
<tr class="memdesc:aec19d58856a0cf0b48d783119a497233"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the given random number seed.  <a href="#aec19d58856a0cf0b48d783119a497233">More...</a><br /></td></tr>
<tr class="separator:aec19d58856a0cf0b48d783119a497233"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a168e77d82ce1e66c6759e97ef27adbbc"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random.html#a168e77d82ce1e66c6759e97ef27adbbc">SeedRandOnce</a> ()</td></tr>
<tr class="memdesc:a168e77d82ce1e66c6759e97ef27adbbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the random number seed to the current time only the first time this function is called.  <a href="#a168e77d82ce1e66c6759e97ef27adbbc">More...</a><br /></td></tr>
<tr class="separator:a168e77d82ce1e66c6759e97ef27adbbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3652f5d105ca4f6f22696b64f2a4a5d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random.html#ad3652f5d105ca4f6f22696b64f2a4a5d">SeedRandOnce</a> (int seed)</td></tr>
<tr class="memdesc:ad3652f5d105ca4f6f22696b64f2a4a5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the given random number seed only the first time this function is called.  <a href="#ad3652f5d105ca4f6f22696b64f2a4a5d">More...</a><br /></td></tr>
<tr class="separator:ad3652f5d105ca4f6f22696b64f2a4a5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-static-attribs"></a>
Static Private Attributes</h2></td></tr>
<tr class="memitem:af24ca62703bbf7428a4ea7787144bfb9"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_utils_1_1_random.html#af24ca62703bbf7428a4ea7787144bfb9">m_already_seeded</a> = false</td></tr>
<tr class="memdesc:af24ca62703bbf7428a4ea7787144bfb9"><td class="mdescLeft">&#160;</td><td class="mdescRight">If <a class="el" href="class_d_utils_1_1_random.html#a168e77d82ce1e66c6759e97ef27adbbc" title="Sets the random number seed to the current time only the first time this function is called...">SeedRandOnce()</a> or <a class="el" href="class_d_utils_1_1_random.html#ad3652f5d105ca4f6f22696b64f2a4a5d" title="Sets the given random number seed only the first time this function is called. ">SeedRandOnce(int)</a> have already been called.  <a href="#af24ca62703bbf7428a4ea7787144bfb9">More...</a><br /></td></tr>
<tr class="separator:af24ca62703bbf7428a4ea7787144bfb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Functions to generate pseudo-random numbers. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a2c769bcd60a08fc3eba3ef4abf9761d5"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static T DUtils::Random::RandomGaussianValue </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>mean</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>sigma</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a random number from a gaussian distribution. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mean</td><td></td></tr>
    <tr><td class="paramname">sigma</td><td>standard deviation </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aa25012101ecbca54025d5430bcf93d86"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int DUtils::Random::RandomInt </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a random int in the range [min..max]. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">min</td><td></td></tr>
    <tr><td class="paramname">max</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>random int in [min..max] </dd></dl>

</div>
</div>
<a id="ac5d2e4d977afdec30071c531a7a96d88"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static T DUtils::Random::RandomValue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a random number in the range [0..1]. </p>
<dl class="section return"><dt>Returns</dt><dd>random T number in [0..1] </dd></dl>

</div>
</div>
<a id="a13760f5d6d4b866fbcc350dbb0d39d02"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static T DUtils::Random::RandomValue </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a random number in the range [min..max]. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">min</td><td></td></tr>
    <tr><td class="paramname">max</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>random T number in [min..max] </dd></dl>

</div>
</div>
<a id="a719a6489316343a771e062f0be58050f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void DUtils::Random::SeedRand </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the random number seed to the current time. </p>

</div>
</div>
<a id="aec19d58856a0cf0b48d783119a497233"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void DUtils::Random::SeedRand </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>seed</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the given random number seed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">seed</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a168e77d82ce1e66c6759e97ef27adbbc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void DUtils::Random::SeedRandOnce </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the random number seed to the current time only the first time this function is called. </p>

</div>
</div>
<a id="ad3652f5d105ca4f6f22696b64f2a4a5d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void DUtils::Random::SeedRandOnce </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>seed</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the given random number seed only the first time this function is called. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">seed</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="af24ca62703bbf7428a4ea7787144bfb9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool DUtils::Random::m_already_seeded = false</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>If <a class="el" href="class_d_utils_1_1_random.html#a168e77d82ce1e66c6759e97ef27adbbc" title="Sets the random number seed to the current time only the first time this function is called...">SeedRandOnce()</a> or <a class="el" href="class_d_utils_1_1_random.html#ad3652f5d105ca4f6f22696b64f2a4a5d" title="Sets the given random number seed only the first time this function is called. ">SeedRandOnce(int)</a> have already been called. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/home/alejandro/Desarrollo eclipse/os1/Thirdparty/DBoW2/DUtils/<a class="el" href="_random_8h_source.html">Random.h</a></li>
<li>/home/alejandro/Desarrollo eclipse/os1/Thirdparty/DBoW2/DUtils/<a class="el" href="_random_8cpp.html">Random.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_d_utils.html">DUtils</a></li><li class="navelem"><a class="el" href="class_d_utils_1_1_random.html">Random</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
  </ul>
</div>
</body>
</html>
